package enum04;

/**
 * java中利用enum关键字定义枚举
 * 格式:
 *  权限修饰符 enum 枚举名称{
 *      枚举常量1,枚举常量2,枚举常量3,...;
 *  }
 *  Java中利用enum定义的枚举的原理和我们自己模拟的枚举原理相同
 *
 *  MONDAY("星期一")相当于:public static final Week MONDAY = new Week("星期一");
 */
public enum Week {
	MONDAY("星期一"),TUESDAY("星期二"),
	WEDNESDAY("星期三"),THURSDAY("星期四"),
	FRIDAY("星期五"),SATURDAY("星期六"),SUNDAY("星期日");

	private String weekName;//定义一个接收星期名称的成员变量

	private Week(String weekName) {
		this.weekName = weekName;
	}

	private Week() {

	}
	@Override
	public String toString() {
		return weekName;
	}

}
